#include "graphicElement.h"
#include <stdlib.h>
#include <stdio.h>

/**********************************************************/
/*                  Constructeurs                         */
/**********************************************************/

GraphicElement::GraphicElement(int aType)
{
    InitBooleans();

    type=aType;

    translation= new Vectorf(0,0,0);
    rotation = new Vectorf(0,0,0);
    barycentre=new Vectorf(0,0,0);
}

GraphicElement::GraphicElement(int aType, Vectorf aTranslation)
{
    InitBooleans();

    type=aType;

    translation= new Vectorf(aTranslation);
    rotation= new Vectorf(0,0,0);
    barycentre=new Vectorf(0,0,0);
}

GraphicElement::GraphicElement(int aType, Vectorf aTranslation, Vectorf aRotation)
{
    InitBooleans();

    type=aType;

    translation= new Vectorf(aTranslation);
    rotation = new Vectorf(aRotation);
    barycentre=new Vectorf(0,0,0);

}

void GraphicElement::InitBooleans()
{
    picking=0;
    state=1;
    movable=0;
    gravity=0;
    valGravity=0.0;
}

GraphicElement::~GraphicElement()
{

}


void GraphicElement::CheckInputDelegates()
{
    for(int j=0;j<inputDelegates.size();j++)
    {
        inputDelegates.at(j)->Update();
    }
}

void GraphicElement::CheckDelegates()
{
    for(int j=0;j<delegates.size();j++)
    {
        delegates.at(j)->Update();
    }
}


void GraphicElement::SetLight()
{
    lightOn=1;
    material=new Material();
}
